home *** CD-ROM | disk | FTP | other *** search
- /**
- GRAB Graph Layout and Browser System
-
- Copyright (c) 1987, 1988, 1989 Stanford University
- Copyright (c) 1989, Tera Computer Company
- **/
-
- /*
- * A mymenu is a list of items to select from using the mouse.
- * Just like a menu in InterViews 2.5, except it doesn't pop up in the
- * same location where it was last time
- */
-
- #ifndef mymenu_h
- #define mymenu_h
-
- #include <InterViews/scene.h>
-
- class MyMenu : public MonoScene
- {
- public:
- MyMenu(boolean persistent = true);
- MyMenu(const char*, boolean persistent = true);
- MyMenu(Sensor*, Painter*, boolean persistent = true);
- void Compose();
- void GetSelection (Interactor*& i) { i = cur; }
- void Handle(Event&);
- void Popup(Event&, Interactor*&);
- protected:
- Scene* layout;
- Interactor* cur;
- Coord xoff, yoff;
-
- void DoInsert(Interactor*, boolean, Coord&, Coord&);
- private:
- boolean persistent;
-
- void Init();
- void Reconfig();
- };
-
- /*
- * A mymenuitem is an interactor that highlights itself when
- * it gets focus, and unhighlights itself when it loses focus.
- */
-
- class MyMenuItem : public Interactor {
- public:
- int tag;
-
- MyMenuItem(int = 0);
- MyMenuItem(const char*, int = 0);
- MyMenuItem(Painter*, int = 0);
- ~MyMenuItem();
-
- virtual void Handle(Event&);
- virtual void Highlight();
- virtual void UnHighlight();
- protected:
- Painter* highlight;
- Painter* normal;
-
- virtual void Reconfig();
- private:
- void Init(int);
- };
-
- class TextItem : public MyMenuItem {
- public:
- TextItem(const char*, int = 0);
- TextItem(const char*, const char*, int = 0);
- TextItem(Painter*, const char*, int = 0);
- protected:
- const char* text;
-
- virtual void Reconfig();
- virtual void Redraw(Coord, Coord, Coord, Coord);
- private:
- void Init(const char*);
- };
-
- #endif
-